#include <iostream>
using namespace std;
#include "proc_stat.h"
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
int main(int argc, char* argv[])
{
    int pid = atol(argv[1]);
    int seconds = atol(argv[2]);
    float cpu[1024];
    float mem;
    unsigned long long uptime;
    bool ret;
    
    int idx = 0;
    while(idx < seconds) {
        ret = get_process_usage(pid, cpu[idx], mem, uptime);
        assert(ret);

        printf("[%d] %f\n", idx, cpu[idx]);

        idx ++;
        sleep(1);
    }

    return 0;
}
